//
//  ASTermsSupport.swift
//  Alamofire
//
//  Created by zhu xietong on 2018/2/12.
//

import Foundation
typealias ASTermsAction = (_ actionID:String,_ model:NSMutableDictionary) ->Void



public enum  ASTermsContainer{
    
    case list(
        net:JoTask,
        node:String,
        emptyMsg:String?,
        params:[String:Any]?,
        cellType:NSObject.Type,
        detailType:UIViewController.Type?,
        test:Bool
    )
    
    case as_table (
        title:String,
        emptyMsg:String?,
        net:JoTask,
        params:[String:Any]?,
        node:String,
        cellType:JoCellNode.Type,
        cellHeigth:CGFloat?,
        detailType:UIViewController.Type?,
        test:Bool
    )
    
    case table (
        title:String,
        emptyMsg:String?,
        net:JoTask,
        params:[String:Any]?,
        node:String,
        cellType:JoTableCell.Type,
        cellHeigth:CGFloat?,
        detailType:UIViewController.Type?,
        test:Bool
    )
    
    
    case as_collection (
        title:String,
        emptyMsg:String?,
        net:JoTask,
        params:[String:Any]?,
        node:String,
        cellType:JoCellNode.Type,
        detailType:UIViewController.Type?,
        test:Bool
    )
    
    case none
    
    public var controller:UIViewController{
        get{
            switch self {
            case .as_table(title: _,emptyMsg: _, net: _,params: _, node: _, cellType: _, cellHeigth: _, detailType: _,  test: _):
                let ctr = ASTableContainer()
                ctr.content = self
                return ctr
                //            case .AStable(title: _,emptyMsg: _, net: _,params: _, node: _, cellType: _, cellHeigth: _, detailType: _,  test: _):
                //                let ctr = ASTableContainer()
                //                ctr.content = self
                //                return ctr
                
            
    
                
            default:
                return ASTableContainer()
            }
        }
    }
    
}
